//
//  NSString+Date.m
//  IkongWuProgram
//
//  Created by 谢志振 on 16/3/11.
//  Copyright © 2016年 Vdianjing. All rights reserved.
//

#import "NSString+Date.h"

@implementation NSString (Date)

+(NSString*)getTimeWith:(NSString*)str
{
    NSDate * date = [NSDate dateWithTimeIntervalSince1970:[str floatValue]];
    NSDateFormatter *outputFormat = [[NSDateFormatter alloc] init];
    [outputFormat setDateFormat:@"yyyy-MM-dd"];
    NSString * newDateString = [outputFormat stringFromDate:date];
    return newDateString;
}
+(NSString*)getMinTimeWith:(NSString*)str
{
    NSDate * date = [NSDate dateWithTimeIntervalSince1970:[str floatValue]];
    NSDateFormatter *outputFormat = [[NSDateFormatter alloc] init];
    [outputFormat setDateFormat:@"yyyy-MM-dd HH:mm"];
    NSString * newDateString = [outputFormat stringFromDate:date];
    return newDateString;
}

+(NSString *)getCurrentTimeStamp
{
    return [NSString stringWithFormat:@"%.0f", [[NSDate date] timeIntervalSince1970]];
}

@end
